CFLAGS=-I../../
CFLAGS+=-I../../third_party/flatbuffers/include
CFLAGS+=-I../../third_party/gemmlowp
CFLAGS+=-I../../tensorflow/lite/
CFLAGS+=-I.
CFLAGS+=-I../../third_party/ruy/
CFLAGS+=-g -DTF_LITE_STATIC_MEMORY
CFLAGS+=-fno-threadsafe-statics -Wno-switch-default -fno-rtti -fno-exceptions
TARGET:=hello_world
CC:=gcc
CXX:=g++

STATIC_FLAGS=../../tensorflow/lite/tflite.a
STATIC_FLAGS=
LDFLAGS=

SRC=../../tensorflow/lite/core/api/error_reporter.cc ../../tensorflow/lite/core/api/flatbuffer_conversions.cc ../../tensorflow/lite/core/api/tensor_utils.cc ../../tensorflow/lite/core/c/common.cc ../../tensorflow/lite/kernels/internal/common.cc ../../tensorflow/lite/kernels/internal/portable_tensor_utils.cc ../../tensorflow/lite/kernels/internal/quantization_util.cc ../../tensorflow/lite/kernels/internal/reference/comparisons.cc ../../tensorflow/lite/kernels/internal/reference/portable_tensor_utils.cc ../../tensorflow/lite/kernels/internal/tensor_ctypes.cc ../../tensorflow/lite/kernels/internal/tensor_utils.cc ../../tensorflow/lite/kernels/kernel_util.cc ../../tensorflow/lite/micro/arena_allocator/non_persistent_arena_buffer_allocator.cc ../../tensorflow/lite/micro/arena_allocator/persistent_arena_buffer_allocator.cc ../../tensorflow/lite/micro/arena_allocator/recording_single_arena_buffer_allocator.cc ../../tensorflow/lite/micro/arena_allocator/single_arena_buffer_allocator.cc ../../tensorflow/lite/micro/debug_log.cc ../../tensorflow/lite/micro/fake_micro_context.cc ../../tensorflow/lite/micro/flatbuffer_utils.cc ../../tensorflow/lite/micro/kernels/activations.cc ../../tensorflow/lite/micro/kernels/activations_common.cc ../../tensorflow/lite/micro/kernels/add.cc ../../tensorflow/lite/micro/kernels/add_common.cc ../../tensorflow/lite/micro/kernels/add_n.cc ../../tensorflow/lite/micro/kernels/arg_min_max.cc ../../tensorflow/lite/micro/kernels/assign_variable.cc ../../tensorflow/lite/micro/kernels/batch_matmul.cc ../../tensorflow/lite/micro/kernels/batch_to_space_nd.cc ../../tensorflow/lite/micro/kernels/broadcast_args.cc ../../tensorflow/lite/micro/kernels/broadcast_to.cc ../../tensorflow/lite/micro/kernels/call_once.cc ../../tensorflow/lite/micro/kernels/cast.cc ../../tensorflow/lite/micro/kernels/ceil.cc ../../tensorflow/lite/micro/kernels/circular_buffer.cc ../../tensorflow/lite/micro/kernels/circular_buffer_common.cc ../../tensorflow/lite/micro/kernels/comparisons.cc ../../tensorflow/lite/micro/kernels/concatenation.cc ../../tensorflow/lite/micro/kernels/conv.cc ../../tensorflow/lite/micro/kernels/conv_common.cc ../../tensorflow/lite/micro/kernels/cumsum.cc ../../tensorflow/lite/micro/kernels/depth_to_space.cc ../../tensorflow/lite/micro/kernels/depthwise_conv.cc ../../tensorflow/lite/micro/kernels/depthwise_conv_common.cc ../../tensorflow/lite/micro/kernels/dequantize.cc ../../tensorflow/lite/micro/kernels/dequantize_common.cc ../../tensorflow/lite/micro/kernels/detection_postprocess.cc ../../tensorflow/lite/micro/kernels/div.cc ../../tensorflow/lite/micro/kernels/elementwise.cc ../../tensorflow/lite/micro/kernels/elu.cc ../../tensorflow/lite/micro/kernels/embedding_lookup.cc ../../tensorflow/lite/micro/kernels/ethosu.cc ../../tensorflow/lite/micro/kernels/exp.cc ../../tensorflow/lite/micro/kernels/expand_dims.cc ../../tensorflow/lite/micro/kernels/fill.cc ../../tensorflow/lite/micro/kernels/floor.cc ../../tensorflow/lite/micro/kernels/floor_div.cc ../../tensorflow/lite/micro/kernels/floor_mod.cc ../../tensorflow/lite/micro/kernels/fully_connected.cc ../../tensorflow/lite/micro/kernels/fully_connected_common.cc ../../tensorflow/lite/micro/kernels/gather.cc ../../tensorflow/lite/micro/kernels/gather_nd.cc ../../tensorflow/lite/micro/kernels/hard_swish.cc ../../tensorflow/lite/micro/kernels/hard_swish_common.cc ../../tensorflow/lite/micro/kernels/if.cc ../../tensorflow/lite/micro/kernels/kernel_runner.cc ../../tensorflow/lite/micro/kernels/kernel_util.cc ../../tensorflow/lite/micro/kernels/l2_pool_2d.cc ../../tensorflow/lite/micro/kernels/l2norm.cc ../../tensorflow/lite/micro/kernels/leaky_relu.cc ../../tensorflow/lite/micro/kernels/leaky_relu_common.cc ../../tensorflow/lite/micro/kernels/log_softmax.cc ../../tensorflow/lite/micro/kernels/logical.cc ../../tensorflow/lite/micro/kernels/logical_common.cc ../../tensorflow/lite/micro/kernels/logistic.cc ../../tensorflow/lite/micro/kernels/logistic_common.cc ../../tensorflow/lite/micro/kernels/lstm_eval.cc ../../tensorflow/lite/micro/kernels/lstm_eval_common.cc ../../tensorflow/lite/micro/kernels/maximum_minimum.cc ../../tensorflow/lite/micro/kernels/micro_tensor_utils.cc ../../tensorflow/lite/micro/kernels/mirror_pad.cc ../../tensorflow/lite/micro/kernels/mul.cc ../../tensorflow/lite/micro/kernels/mul_common.cc ../../tensorflow/lite/micro/kernels/neg.cc ../../tensorflow/lite/micro/kernels/pack.cc ../../tensorflow/lite/micro/kernels/pad.cc ../../tensorflow/lite/micro/kernels/pooling.cc ../../tensorflow/lite/micro/kernels/pooling_common.cc ../../tensorflow/lite/micro/kernels/prelu.cc ../../tensorflow/lite/micro/kernels/prelu_common.cc ../../tensorflow/lite/micro/kernels/quantize.cc ../../tensorflow/lite/micro/kernels/quantize_common.cc ../../tensorflow/lite/micro/kernels/read_variable.cc ../../tensorflow/lite/micro/kernels/reduce.cc ../../tensorflow/lite/micro/kernels/reduce_common.cc ../../tensorflow/lite/micro/kernels/reshape.cc ../../tensorflow/lite/micro/kernels/reshape_common.cc ../../tensorflow/lite/micro/kernels/resize_bilinear.cc ../../tensorflow/lite/micro/kernels/resize_nearest_neighbor.cc ../../tensorflow/lite/micro/kernels/round.cc ../../tensorflow/lite/micro/kernels/select.cc ../../tensorflow/lite/micro/kernels/shape.cc ../../tensorflow/lite/micro/kernels/slice.cc ../../tensorflow/lite/micro/kernels/softmax.cc ../../tensorflow/lite/micro/kernels/softmax_common.cc ../../tensorflow/lite/micro/kernels/space_to_batch_nd.cc ../../tensorflow/lite/micro/kernels/space_to_depth.cc ../../tensorflow/lite/micro/kernels/split.cc ../../tensorflow/lite/micro/kernels/split_v.cc ../../tensorflow/lite/micro/kernels/squared_difference.cc ../../tensorflow/lite/micro/kernels/squeeze.cc ../../tensorflow/lite/micro/kernels/strided_slice.cc ../../tensorflow/lite/micro/kernels/strided_slice_common.cc ../../tensorflow/lite/micro/kernels/sub.cc ../../tensorflow/lite/micro/kernels/sub_common.cc ../../tensorflow/lite/micro/kernels/svdf.cc ../../tensorflow/lite/micro/kernels/svdf_common.cc ../../tensorflow/lite/micro/kernels/tanh.cc ../../tensorflow/lite/micro/kernels/transpose.cc ../../tensorflow/lite/micro/kernels/transpose_conv.cc ../../tensorflow/lite/micro/kernels/unidirectional_sequence_lstm.cc ../../tensorflow/lite/micro/kernels/unpack.cc ../../tensorflow/lite/micro/kernels/var_handle.cc ../../tensorflow/lite/micro/kernels/while.cc ../../tensorflow/lite/micro/kernels/zeros_like.cc ../../tensorflow/lite/micro/memory_helpers.cc ../../tensorflow/lite/micro/memory_planner/greedy_memory_planner.cc ../../tensorflow/lite/micro/memory_planner/linear_memory_planner.cc ../../tensorflow/lite/micro/memory_planner/non_persistent_buffer_planner_shim.cc ../../tensorflow/lite/micro/micro_allocation_info.cc ../../tensorflow/lite/micro/micro_allocator.cc ../../tensorflow/lite/micro/micro_context.cc ../../tensorflow/lite/micro/micro_interpreter.cc ../../tensorflow/lite/micro/micro_interpreter_context.cc ../../tensorflow/lite/micro/micro_interpreter_graph.cc ../../tensorflow/lite/micro/micro_log.cc ../../tensorflow/lite/micro/micro_op_resolver.cc ../../tensorflow/lite/micro/micro_profiler.cc ../../tensorflow/lite/micro/micro_resource_variable.cc ../../tensorflow/lite/micro/micro_time.cc ../../tensorflow/lite/micro/micro_utils.cc ../../tensorflow/lite/micro/mock_micro_graph.cc ../../tensorflow/lite/micro/recording_micro_allocator.cc ../../tensorflow/lite/micro/system_setup.cc ../../tensorflow/lite/micro/test_helper_custom_ops.cc ../../tensorflow/lite/micro/test_helpers.cc ../../tensorflow/lite/micro/tflite_bridge/flatbuffer_conversions_bridge.cc ../../tensorflow/lite/micro/tflite_bridge/micro_error_reporter.cc ../../tensorflow/lite/schema/schema_utils.cc
SRC+=hello_world_test.cc
MODELS_SRC=${wildcard models/*.cc}

OBJS=$(SRC:.cc=.o)
OBJS+=$(MODELS_SRC:.cc=.o)

$(TARGET):$(OBJS)
	$(CXX) $^ $(STATIC_FLAGS) $(LDFLAGS) -o $@

%.o:%.cc
	$(CXX) $< -c $(CFLAGS) -o $@

clean:
	rm -frv $(TARGET) $(OBJS)

.PHONY:clean
